<?php
namespace Admin\Controller;
use Think\Controller;

/**
 * 总后台登陆
 */
class IndexController extends Controller {
    
    //登陆界面
    public function index(){
        $this->display();
    }
    
    
    
    //登录页面
	public function go_login(){
		$username = I("post.username");
		$password = I("post.password");
		if($username=='admin' && $password=='zhangyu2016'){
			session('admin_id','admin');
			$returnCode = array();
			$returnCode['message'] = "登录成功";
			$returnCode['href'] = \Org\Net\Fun::url('admin/home/exchangeList');;
			echo json_encode($returnCode);exit;
		} else {
			$returnCode = array();
			$returnCode['message'] = "登录失败";
			echo json_encode($returnCode);exit;
		}
	}
}